package com.bxl.chooser.bean;

/**
 * <>
 *
 * @author baixl
 * @date 2021/3/29
 */
public class MessageBean {
    private String messageId;
    private String content;
    private MessageState state;
    private int term;
    private int index;

    public String getMessageId() {
        return messageId;
    }
    public MessageBean(String messageId, String content,  int term, int index) {
        this.messageId = messageId;
        this.content = content;
        this.term = term;
        this.index = index;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public MessageState getState() {
        return state;
    }

    public void setState(MessageState state) {
        this.state = state;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public enum MessageState{
        UNCOMMIT(0,"未提交"),COMMITTED(1,"已提交"),DELETED(2,"已删除");
        private int value;
        private String desc;

        MessageState(int value, String desc) {
            this.value = value;
            this.desc = desc;
        }

        public int getValue() {
            return value;
        }

        public void setValue(int value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    public int getTerm() {
        return term;
    }

    public void setTerm(int term) {
        this.term = term;
    }
}
